<template>
  <div class="App">
    <Table />
    <Form />
  </div>
</template>

<script>
import moment from 'moment'
//引入组件
import Table from './components/01_table表单.vue'
import Form from './components/02_添加form.vue'
export default {
  name: 'ScoreCase',
  //注册组件
  components: {
    Table,
    Form,
  },
  data() {
    return {
      list: [
        {
          id: 15,
          subject: '语文',
          score: 89,
          date: new Date('2022/06/07 10:00:00'),
        },
        {
          id: 27,
          subject: '数学',
          score: 100,
          date: new Date('2022/06/07 15:00:00'),
        },
        {
          id: 32,
          subject: '英语',
          score: 56,
          date: new Date('2022/06/08 10:00:00'),
        },
        {
          id: 41,
          subject: '物理',
          score: 76,
          date: new Date('2022/06/08 10:00:00'),
        },
      ],
      subject: '',
      score: '',
    }
  },
  methods: {
    // 格式化时间
    formatDate(a) {
      return moment(a).format('YYYY-MM-DD HH:mm:ss')
    },
  },
}
</script>

<style lang="less">
.App {
  width: 1000px;
  margin: 50px auto;
  display: flex;
}
</style>
